// import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

import { ServiceProvider } from '../service/service'
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';

/*
  Generated class for the ApiProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class ApiProvider {

    constructor( public service: ServiceProvider) {
        console.log('Hello ApiProvider Provider');
    }

    //  日榜
    public rankD = p => this.service.post('/Apiranking/ranking_daily', p);
    // 周榜
    public rankW = p => this.service.post('/apiranking/ranking_weekly', p);
    // 月榜
    public rankM = p => this.service.post('/apiranking/ranking_monthly', p);

    // 代理中心
    public agent = p => this.service.post('/agent/info', p);
    // 一级下线
    public oneLine = p => this.service.post('/apimy/get_oneline', p);
    // 二级下线
    public twoLine = p => this.service.post('/apimy/get_twoline', p);

    // 获取微信授权的信息
    public weChatMes = p => this.service.post('/apiindex/verify', p);

    // 抢购信息，我的购买
    public myBuy = p => this.service.post('/apimy/my_buying', p);
    // 提现记录
    public cashRecord = p => this.service.post('/apimy/put_forward', p);
    // 添加银行卡
    public addBank = p => this.service.post('/blank/save', p);
    // 银行卡列表
    public banklist = p => this.service.post('/bank/banklist', p);
    // 获取客服二维码
    public qrcode = p => this.service.post('/apimy/get_kfcode', p);
    // 用户信息
    public userinfo = p => this.service.post('/apiindex/index_userinfo', p);
    // 查看绑定银行卡信息
    public isBindBank = p => this.service.post('/blank/isbind', p);
    // 提现页面信息
    public cashMes = p => this.service.post('/Putforward/index', p);
    // 提现操作
    public cash = p => this.service.post('/Putforward/tx', p);

    // 充值（支付宝）
    public aliPay = p => this.service.post('/recharge/index', p);
    // 充值（微信）
    public weChat = p => this.service.post('/recharge/wechat', p);
    // 充值（客服代充二维码）
    public Kf = p => this.service.post('/recharge/kf', p);

}
